//
// Created by zerax on 2020/10/27.
//

#pragma once

#include <glad/glad.h>
#include "utils.hh"
#include "shader_manager.hh"

enum class TextureFormat {
    RGB, RGBA
};

class Texture {
public:
    Texture() = default;
    ~Texture();
    Texture(int width, int height, const void* pixels = nullptr, TextureFormat format = TextureFormat::RGB);
    DELETE_COPY(Texture);

    void setBindPoint(const char* name, unsigned int bindPosition);

    void bind(const Shader& shader) const;
    void unbind();

private:
    GLuint m_rawHandle = 0;
    std::pair<const char*, unsigned int> m_bindPoint { "tex", 0 };
};


